package com.mcms.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class DictUtil {

	public static List<Map<String,String>> getDictUtil(String dictType){
		
		List<Map<String,String>> listResult = new ArrayList<Map<String,String>>();
		DBHelper dbh = DBHelper.getInstance();
		String sqlStr = "select t.dict_code,t.dict_name from mcms_com_dict t where t.dict_type='"+dictType+"' order by t.dict_order";
		listResult = dbh.query(sqlStr);
		return listResult;
	}
	
	public static void main(String[] args){
		List<Map<String,String>> listResult = getDictUtil("ACTION");
		for(int i=0;i<listResult.size();i++){
			Map<String,String> map = listResult.get(i);
			String code = MapUtil.getString(map, "dict_code");
			String name = MapUtil.getString(map, "dict_name");
			System.out.println("code="+code+"------name="+name);
		}
	}
}
